from django.db import models
from user.models import UserModel
from cake.models import CakesModel
# Create your models here.
class CartModel(models.Model):
    user = models.ForeignKey(UserModel,on_delete=models.CASCADE,verbose_name='用户')
    cname = models.ForeignKey(CakesModel,on_delete=models.CASCADE,verbose_name='蛋糕')
    num = models.IntegerField(verbose_name='数量')
    select = models.BooleanField(default=False,verbose_name='选择')
    price = models.IntegerField(default=1,verbose_name="价格",null=True,blank=True)
    pound= models.IntegerField(default=1,verbose_name='磅',null=True,blank=True)
    class Meta:
        db_table = 'carts'
    def __str__(self):
        return self.cname


